package com.vueperson.vueperson;

import com.vueperson.vueperson.filters.UTF_Filter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@SpringBootApplication

@EnableJpaAuditing
@ComponentScan(basePackages = "com.vueperson")
public class VuepersonApplication extends SpringBootServletInitializer {
//
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//        return builder.sources(VuepersonApplication.class);
//    }

    public static void main(String[] args) {
        SpringApplication.run(VuepersonApplication.class, args);
    }

    /**
     * 注册Filter
     * @return
     */

    @Bean
    public FilterRegistrationBean getFilterRegistrationBean(){
        FilterRegistrationBean bean =new FilterRegistrationBean(new UTF_Filter());
        bean.addUrlPatterns("/*");
        return bean;
    }



}
